package Service.impl;

import Service.IUserService;
import dao.IUserDao;
import dao.impl.UserDaoImpl;
import pojo.User;
import java.util.List;

public class  UserServiceImpl implements IUserService {
    private IUserDao userDao = new UserDaoImpl();
    @Override
    public User login(String name, String password) {
        return userDao.findByNameAnaPassword(name,password);
    }

    @Override
    public void addUser(User user) {
        userDao.addUser(user);
    }

    @Override
    public void updateUser(User user) {
        userDao.updateUser(user);
    }

    @Override
    public void deleteUser(User user) {
        userDao.deleteUser(user);
    }
    @Override
    public User findByid(int id) {
        return userDao.findByid(id);
    }

    @Override
    public List<User> findAll() {
        return userDao.findAll();
    }

    @Override
    public List<User> findLinkName(String name) {
        return userDao.findLinkName(name);
    }
}
